/*
 * @# VideoExtractorAction.java 2011-11-30 下午02:24:56
 * 
 * Copyright (C) 2010 - 2011 广州羿安信息科技有限公司
 * Guangzhou ianswer information technology co. ltd.
 * 
 * All rights reserved!
 */
package com.ianswer.experiments.templates;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;

import com.ianswer.common.struts.BaseAction;
import com.ianswer.common.video.Video;
import com.ianswer.common.video.VideoExtractor;

/**
 * @author alvin hwang
 */
@Namespace("/video")
public class VideoExtractorAction extends BaseAction {

	private static final long serialVersionUID = -5638144658806501187L;
	
	private String url;
	
	@Action(value = "extract")
	public String extract() {
		Video video = VideoExtractor.extract(url);
		writeJson(video);
		return NONE;
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
}
